/**
 * 报表设计公司(2011)
 */
package com.reportgear.report.view.cursor;

import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;

import com.reportgear.report.view.cursor.png.CursorPNG;

/**
 * 光标实用类
 * 
 * @version 1.0 2011-3-14
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 * 
 */
public final class CursorUtils {
	public static final Cursor CURSOR_DEFAULT = Toolkit.getDefaultToolkit().createCustomCursor(
			readPngImage(CursorPNG.CELL_DEFAULT), new Point(16, 16), "CellDefault");
	public static final Cursor CURSOR_V_SELECT = Toolkit.getDefaultToolkit().createCustomCursor(
			readPngImage(CursorPNG.CUROSR_V_SELECT), new Point(16, 16), "VerticalSelect");
	public static final Cursor CURSOR_V_MOVE = Toolkit.getDefaultToolkit().createCustomCursor(
			readPngImage(CursorPNG.CURSOR_V_MOVE), new Point(16, 16), "VerticalMove");
	public static final Cursor CURSOR_H_SELECT = Toolkit.getDefaultToolkit().createCustomCursor(
			readPngImage(CursorPNG.CURSOR_H_SELECT), new Point(16, 16), "HorizentalSelect");
	public static final Cursor CURSOR_H_MOVE = Toolkit.getDefaultToolkit().createCustomCursor(
			readPngImage(CursorPNG.CURSOR_H_MOVE), new Point(16, 16), "HorizentalMove");

	/**
	 * 读取PNG文件
	 * 
	 * @param fileName
	 *            文件名
	 * @return 图像对象
	 */
	private static Image readPngImage(String fileName) {
		return CursorPNG.readImage(fileName);
	}
}
